package com.crape.topic.dao;

import java.util.List;

import com.crape.common.exceptions.DAOException;
import com.crape.common.model.Article;

public interface IArticleDAO {
	
	List<Article> searchArticles(String searchValue, Integer startIndex, Integer pageSize) throws DAOException;

	Long countSearchArticles(String searchValue) throws DAOException;

	Long getMaxArticleId() throws DAOException;

	List<Article> listArticles(Article article) throws DAOException;

	List<Article> getHotArticles() throws DAOException;

	List<Article> getNext4Articles(Long subjectid, Long articleid) throws DAOException;

	List<Article> getAuthorOtherArticles(Long accountid, Long articleid, Integer pageSize) throws DAOException;
	
	List<Article> getSubjectOtherArticles(Long subjectid, Long articleid, Integer pageSize) throws DAOException;

	List<Article> getAllArticles(Integer startIndex, Integer pageSize) throws DAOException;

	Long countAllArticles() throws DAOException;

	List<Article> getArticlesByAccountid(Long accountid, Integer startIndex, Integer pageSize) throws DAOException;

	Long countArticlesByAccountid(Long accountid) throws DAOException;

	List<Article> getCommentArticlesByAccountid(Long accountid, Integer startIndex, Integer pageSize) throws DAOException;

	Long countCommentArticlesByAccountid(Long accountid) throws DAOException;

	List<Article> getArticlesBySubjectid(Long subjectid, Integer startIndex, Integer pageSize) throws DAOException;

	Long countArticlesBySubjectid(Long subjectid) throws DAOException;

	Long insertArticle(Article article) throws DAOException;

	void updateArticle(Article article) throws DAOException;

	void deleteArticleById(Long id) throws DAOException;
	
	Long countArticleCommentsByid(Long articleid) throws DAOException;
	
	Long countArticleRecommendsByid(Long articleid) throws DAOException;
	
	Long countArticleReplysByid(Long articleid) throws DAOException;
	
	Long countArticleVisitorsByid(Long articleid) throws DAOException;
	
	void updateArticleComments(Long id, Long count) throws DAOException;

	void updateArticleRecommends(Long id, Long count) throws DAOException;
	
	void updateArticleReplys(Long id, Long count) throws DAOException;

	void updateArticleVisitors(Long id, Long count) throws DAOException;
	
	void addArticleViews(Long id) throws DAOException;

}
